using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using Aocsoft.Infrastructure.DomainBase;

namespace Aocsoft.Infrastructure.RepositoryFramework
{
    public interface IRepository<TEntity, TKey> where TEntity : EntityBase
    {
        IUnitOfWork UnitOfWork { get; }
        TEntity FindBy(TKey key);
        IList<TEntity> FindAll();
        void Add(TEntity item);
        TEntity this[TKey key] { get; set; }
        void Remove(TEntity item);
        void RemoveAll(Expression<Func<TEntity, bool>> predicate = null);
    }
}
